home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
akcl
/
akcl.lha
/
akcl
/
V
/
c
/
read.d
< prev
next >
Wrap
Text File
|
1990-04-09
|
7KB
|
485 lines
Changes file for /usr/local/src/kcl/c/read.d
Created on Mon Apr 9 09:37:10 1990
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files. Anything not between
"\n@s[" and "\n@s]" is a simply a comment.
This file was constructed using emacs and merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
by (Bill Schelter) wfs@carl.ma.utexas.edu
****Change:(orig (15 15 c))
@s[object standard_readtable;
@s|
@s]
****Change:(orig (18 21 d))
@s[object Vreadtable;
object Vread_default_float_format;
object Vread_base;
object Vread_suppress;
@s|
@s]
****Change:(orig (23 44 d))
@s[object Kstart;
object Kend;
object Kradix;
object Kjunk_allowed;
@s,object big_register_0;
@s|
@s]
****Change:(orig (48 48 c))
@s[#define SHARP_EQ_CONTEXT_SIZE 64
@s|#define SHARP_EQ_CONTEXT_SIZE 250
@s]
****Change:(orig (68 68 d))
@s[int sharp_eq_context_max;
@s|
@s]
****Change:(orig (152 152 a))
@s[read_object_recursive(in)
@s|read_object_recursive(in)
object in;
@s]
****Change:(orig (340 340 a))
@s[ setup_standard_READ();
frs_push(FRS_PROTECT, Cnil);
if (nlj_active) {
e = TRUE;
goto L;
}
x = read_object(in);
vs_push(x);
if (sharp_eq_context_max > 0)
x = vs_head = patch_sharp(x);
e = FALSE;
L:
frs_pop();
READtable = old_READtable;
READdefault_float_format = old_READdefault_float_format;
READbase = old_READbase;
READsuppress = old_READsuppress;
sharp_eq_context_max = old_sharp_eq_context_max;
for (i = 0; i < sharp_eq_context_max; i++)
sharp_eq_context[i] = old_sharp_eq_context[i];
backq_level = old_backq_level;
if (e) {
nlj_active = FALSE;
unwind(nlj_fr, nlj_tag);
}
vs_pop;
/* BUG FIX by Toshiba */
vs_pop;
return(x);
}
@s| setup_standard_READ();
frs_push(FRS_PROTECT, Cnil);
if (nlj_active) {
e = TRUE;
goto L;
}
x = read_object(in);
vs_push(x);
if (sharp_eq_context_max > 0)
x = vs_head = patch_sharp(x);
e = FALSE;
L:
frs_pop();
READtable = old_READtable;
READdefault_float_format = old_READdefault_float_format;
READbase = old_READbase;
READsuppress = old_READsuppress;
sharp_eq_context_max = old_sharp_eq_context_max;
for (i = 0; i < sharp_eq_context_max; i++)
sharp_eq_context[i] = old_sharp_eq_context[i];
backq_level = old_backq_level;
if (e) {
nlj_active = FALSE;
unwind(nlj_fr, nlj_tag);
}
vs_pop;
/* BUG FIX by Toshiba */
vs_pop;
return(x);
}
#ifdef UNIX /* faster code for inner loop from file stream */
#define read_char_to(res,in,eof_code) \
do{FILE *fp; \
if(fp=in->sm.sm_fp) \
{int ch = getc(fp); \
if(ch==EOF && feof(fp)) \
{eof_code;} \
else res=code_char(ch);} \
else \
{ if (stream_at_end(in)) \
{eof_code;} \
else res=read_char(in);}} while(0)
#else
#define read_char_to(res,in,eof_code) \
if(stream_at_end(in)) {eof_code ;} \
else res=read_char(in)
#endif
@s]
****Change:(orig (372 380 c))
@s[ do {
if (stream_at_end(in)) {
if (df) {
vs_reset;
@s, }
c = read_char(in);
@s| do { read_char_to(c,in, {
if (df) {
vs_reset;
return(OBJNULL);
} else
end_of_stream(in);
});
@s]
****Change:(orig (430 432 c))
@s[ if (stream_at_end(in))
goto M;
c = read_char(in);
@s| read_char_to(c,in,goto M);
@s]
****Change:(orig (494 494 c))
@s[ token->st.st_fillp = length;
if (escape_flag)
@s| token->st.st_fillp = length;
if (escape_flag || (READbase<=10 && token_buffer[0]>'9'))
@s]
****Change:(orig (601 601 a))
@s[ (i) == 'b' || (i) == 'B')
@s| (i) == 'b' || (i) == 'B')
double pow();
@s]
****Change:(orig (769 781 c))
@s[ fraction_unit = 1.0;
while (d > 0)
if (d%2 == 0) {
d /= 2;
@s, fraction /= fraction_unit;
@s| /* Use pow because it is more accurate */
fraction = fraction * pow(10.0,(double)(sign * d));
@s]
****Change:(orig (785 785 c))
@s[ if ((*(int *)&fraction & 0x7ff00000) == 0x7ff00000)
@s| if ((*((int *)&fraction +HIND) & 0x7ff00000) == 0x7ff00000)
@s]
****Change:(orig (1021 1021 c))
@s[Lsemicolon_reader()
{
object c;
@s|Lsemicolon_reader()
{
object c;
object str= vs_base[0];
@s]
****Change:(orig (1025 1026 c))
@s[ c = read_char(vs_base[0]);
while (char_code(c) != '\n');
@s| { read_char_to(c,str, goto L); }
while (char_code(c) != '\n');
L:
@s]
****Change:(orig (1370 1370 a))
@s[ vs_pop;
if (READsuppress) {
@s| vs_pop;
if (READsuppress) {
read_object(vs_base[0]);
@s]
****Change:(orig (1385 1385 a))
@s[ vs_pop;
if (READsuppress) {
@s| vs_pop;
if (READsuppress) {
read_object(vs_base[0]);
@s]
****Change:(orig (1627 1627 a))
@s[ case t_vector:
{
int i;
@s| case t_vector:
{
int i;
if ((enum aelttype)x->v.v_elttype != aet_object)
break;
@s]
****Change:(orig (1634 1634 a))
@s[ case t_array:
{
int i, j;
@s| case t_array:
{
int i, j;
if ((enum aelttype)x->a.a_elttype != aet_object)
break;
@s]
****Change:(orig (1641 1641 a))
@s[ x->a.a_self[i] = patch_sharp(x->a.a_self[i]);
break;
}
@s| x->a.a_self[i] = patch_sharp(x->a.a_self[i]);
break;
}
case t_structure:
{object def = x->str.str_def;
int i;
i=S_DATA(def)->length;
while (i--> 0)
structure_set(x,def,i,patch_sharp(structure_ref(x,def,i)));
break;
}
@s]
****Change:(orig (1757 1757 c))
@s[ /* structure assignment */
}
@s| /* structure assignment */
} else
rtab=to->rt.rt_self;
@s]
****Change:(orig (1759 1759 c))
@s[ if (rtab[i].rte_dtab != NULL) {
@s| if (from->rt.rt_self[i].rte_dtab != NULL) {
@s]
****Change:(orig (1930 1930 c))
@s[ for (;;) {
c = read_char(strm);
@s| for (;;) {
read_char_to(c,strm,c = Ct; goto FINISH);
@s]
****Change:(orig (1938 1941 d))
@s[ if (stream_at_end(strm)) {
c = Ct;
break;
}
@s|
@s]
****Change:(orig (1942 1942 a))
@s[ }
@s| }
FINISH:
@s]
****Change:(orig (1944 1944 c))
@s[ @(return `copy_simple_string(token)` c)
@s| /* no disadvantage to returning an adjustable string */
{object uu= copy_simple_string(token);
/* uu->st.st_hasfillp=TRUE;
uu->st.st_adjustable=TRUE;
*/
@(return uu c)
}
@s]
****Change:(orig (2125 2125 a))
@s[ @(return `make_fixnum(c)`)
@)
@s| @(return `make_fixnum(c)`)
@)
object
read_byte1(str,eof)
object str,eof;
{if (stream_at_end(str))
return eof;
return make_fixnum(readc_stream(str));}
object
read_char1(str,eof)
object str,eof;
{if (stream_at_end(str))
return eof;
return code_char(readc_stream(str));}
@s]
****Change:(orig (2283 2283 c))
@s[ detect_eos_flag = FALSE;
x = read_object(in);
@s| detect_eos_flag = FALSE;
x = read_object_non_recursive(in);
@s]
****Change:(orig (2531 2531 a))
@s[ make_si_function("STANDARD-READTABLE", siLstandard_readtable);
}
@s| make_si_function("STANDARD-READTABLE", siLstandard_readtable);
}
object siSPinit;
@s]
****Change:(orig (2534 2534 c))
@s[object
read_fasl_vector(in)
@s|object
read_fasl_vector1(in)
@s]
****Change:(orig (2590 2591 c))
@s[ }
x = alloc_simple_vector(dimcount, aet_object);
@s| }
if(dimcount==1 && type_of(vs_head)==t_vector)
{/* new style where all read at once */
x=vs_head;
goto DONE;}
/* old style separately sharped, and no %init */
x=alloc_simple_vector(dimcount,aet_object);
@s]
****Change:(orig (2596 2597 c))
@s[ x->v.v_self[dim] = vsp[dim];
@s| {SGC_TOUCH(x);
x->cfd.cfd_self[dim] = vsp[dim];}
DONE:
@s]